package ynu.edu.achitecturework.service;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import ynu.edu.achitecturework.dao.GreenhouseDAO;
import ynu.edu.achitecturework.entity.Greenhouse;

import java.util.List;

@Service
@RequiredArgsConstructor
public class GreenhouseService {

    private final GreenhouseDAO greenhouseDAO;

    public List<Greenhouse> getAllGreenhouses() {
        return greenhouseDAO.findAll();
    }

    public Greenhouse getGreenhouseByBoxNo(String boxNo) {
        return greenhouseDAO.findByBoxNo(boxNo);
    }
}